//---------------------------------------------------------------------------
#ifndef ClientListH
#define ClientListH

#include <list>
#include <vector>
#include <algorithm>
#include <ScktComp.hpp>
using namespace std;
/*
class Subject;
class Observer{
    public:
      virtual __fastcall ~Observer() = 0;
      virtual void UpdateClient(Subject* Clients) = 0;

};
__fastcall Observer::~Observer()
{

}
class Subject{
    public:
      virtual ~Subject(){}
      virtual void Attach(Observer* obj)
      {
         m_observer = obj;

      }
      virtual void Detach(Observer*)
      {

      }
      virtual void Notify()
      {
         m_observer->UpdateClient(this);
      }

    protected:
      Subject(){}
    private:
      Observer* m_observer;
};    */
//---------------------------------------------------------------------------
class TClientList
{
   public:
       TClientList();

       void AddClient(TCustomWinSocket* cltSkt);
       void DeleteClient(TCustomWinSocket* cltSkt);
       void Clear();
       void ResetActiveClient();
       TCustomWinSocket* GetActiveSocket();
       void SetActiveSocket(TCustomWinSocket*);
       vector<TCustomWinSocket*> Get_OnlineList();
       void SetActiveSocket(int index);
       TCustomWinSocket* operator [] (int pos);
       int  ClientCount();
   private:
       int FindClient(TCustomWinSocket* cltSkt);
       vector<TCustomWinSocket*> m_OnlineSktList;
       TCustomWinSocket* m_ActiveSkt;

};
#endif
